//Sphere.cpp
//Contains the function definitions for the Sphere Class

#include <math.h>
#include <iostream>
#include "Sphere.h"

using namespace std;

Sphere::Sphere(const float &p_X, const float &p_Y, float rad)
	:CircularShapes(p_X, p_Y)
{
	setRadius(rad);
	CircularShapes::setArea(rad);
	setArea(rad);
	setVolume(rad);
	setShapeType("Sphere");
	//setDistance();
}

void Sphere::setRadius(float rad)
{
	if(rad >= 0.0)
		radius = rad;
	else
		cout << "Radius must be greater than zero!";
}

float Sphere::getRadius() const
{
	return radius;
}

void Sphere::setArea(float rad)
{
	Sphere_area = 4 * CircularShapes::getArea();
}

float Sphere::getArea() const
{
	return Sphere_area;
}

void Sphere::setVolume(float rad)
{
	Sphere_volume = 4/3 * 3.14159265359 * pow(rad, 3);
}

float Sphere::getVolume() const
{
	return Sphere_volume;
}

float Sphere::area() const
{
	return getArea();
}

float Sphere::volume() const
{
	return getVolume();
}

